


#ifndef VGRID_H
#define VGRID_H

#include"vshape.h"
#include<stdio.h>

#define _PI 3.1415926535898

class VGrid : public VShape 
{
  private:
  void Init (int n, bool bind_top, bool bind_side);
  void Set2Triangles (int t,int v1,int v2,int v3,int v4);
  protected:
  int n;
  public:
  VGrid (int n, bool bind_top, bool bind_side)
  {
    Init(n, bind_top, bind_side);
  }
  VGrid(int n)
  {
    Init(n, false, false);
  }
  virtual void FillCoordAndBox();
  void CalcNormals ();
  void InvertNormals ();
  void SetupTex (int id);
  void SetupTex (int id,float rep);
  void SetupTex (int id,float repx, float repy);
  void CalcTangentVec (int id, bool bind_side);
};

#endif
